<template>
  <div>
    NewsContent组件
    <br />
    <br />
    <button @click="goHome">js跳转到home组件</button>
  </div>
</template>
<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  data() {
    return {};
  },
  mounted() {
    //this.$route.params 获取动态路由的传值
    // console.log(this.$route.params)

    //this.$route.query 获取get的传值
    console.log(this.$route.query);
  },
  methods: {
    goHome() {
      this.$router.push({ path: "/" });
    },
  },
});
</script>
<style lang="scss">
// npm install -d sass-loader node-sass
</style>
